package com.atguigu.srb.core;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/*
    springboot自动配置：
        项目启动时 会加载配置类 初始化一些对象
        数据库自动配置：一旦项目中引入了数据库依赖，会创建数据库配置类对象 加载数据库配置初始化数据库连接池
 */
@SpringBootApplication//(exclude = {DataSourceAutoConfiguration.class})
@MapperScan(basePackages = "com.atguigu.srb.core.mapper")
//修改当前项目扫描组件的包路径
@ComponentScan(basePackages = {"com.atguigu.srb"})
//@EnableSwagger2 //启用swagger
@EnableCaching
@EnableTransactionManagement //启用声明式事务
public class SrbCoreApplication {
    public static void main(String[] args) {
        SpringApplication.run(SrbCoreApplication.class,args);
    }
}
